from ..rect import Rect

class BaseFormItem:
  def __init__(self, x, y, w, h):
    self.rect = Rect((x, y, w, h))
    self._form = None
    self._hidden = False
    self._interactive = True

  def SetSize(self, w, h):
    self.rect = Rect((self.rect.left, self.rect.top, w, h))

  def OnButtonDown(self, form, event, data, coords):
    pass

  def OnButtonUp(self, form, event, data, coords):
    pass

  def OnMouseMove(self, form, event, data, coords):
    pass

  def Draw(self, screen, window, rect, clip_rect):
    pass

  def Update(self):
    pass

  def GetHeight(self):
    return self.rect.height

  def GetWidth(self):
    return self.rect.width

  def GetLeft(self):
    return self.rect.left

  def SetPosition(self, x, y):
    self.rect.left = x
    self.rect.top = y

  def SetForm(self, form):
    self._form = form

  def GetForm(self):
    return self._form

  def SetHidden(self, hidden):
    self._hidden = hidden

  def GetHidden(self):
    return self._hidden

  def GetInteractive(self):
    return self._interactive

  def SetInteractive(self, value):
    self._interactive = value
